#include "CheckersComputer.h"

CheckersComputer::CheckersComputer()
{
    //ctor

}

CheckersComputer::CheckersComputer(CheckersBoard* pBoard)
{
    //ctor
    this->mCheckersBoard=pBoard;
}

CheckersComputer::~CheckersComputer()
{
    //dtor
}

CheckersComputer::CheckersComputer(const CheckersComputer& other)
{
    //copy ctor
}

CheckersComputer& CheckersComputer::operator=(const CheckersComputer& rhs)
{
    if (this == &rhs) return *this; // handle self assignment
    //assignment operator
    return *this;
}

void CheckersComputer::doComputerMove()
{
    yeah
    setCandidateMove();
    mCheckersBoard->movePiece(candidateMove);
    delete candidateMove;
}

void CheckersComputer::setCandidateMove()
{
    int i=1;
    /*candidateMove.setMove(mCheckersBoard.getLegalMoves().at(i)->getFromRow(),
                          mCheckersBoard.getLegalMoves().at(i)->getFromCol(),
                          mCheckersBoard.getLegalMoves().at(i)->getToRow(),
                          mCheckersBoard.getLegalMoves().at(i)->getToCol());*/
    cout << "fromRow: " << mCheckersBoard->getLegalMoves().at(i)->getFromRow()<<endl;
    cout << "fromCol: " << mCheckersBoard->getLegalMoves().at(i)->getFromCol()<<endl;
    candidateMove = new CheckersMove(mCheckersBoard->getLegalMoves().at(i)->getFromRow(),
                                     mCheckersBoard->getLegalMoves().at(i)->getFromCol(),
                                     mCheckersBoard->getLegalMoves().at(i)->getToRow(),
                                     mCheckersBoard->getLegalMoves().at(i)->getToCol());
    //candidateMove = new mCheckersBoard.getLegalMoves().at(i);
}
